﻿using UnityEngine;
using System.Collections;

public abstract class ControllerBase : MonoBehaviour
{
    public  MessageType type;

    private void Awake()
    {
        print("controller type :" + type);
        if (NetManager._instance == null)
        {
            print("null");
        }
        NetManager._instance.RegistController(type,this);
    }

    public virtual void TranslateObj(object content)
    {
        print(type+"控制器接收到新的消息");
    }

    /// <summary>
    /// 发送消息
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="message"></param>
    public void SendInfoToIpad<T>(T message)
    {
        NetManager._instance.SendToIpad(type,message);
    }
}
